home *** CD-ROM | disk | FTP | other *** search
- 1 rem Addition practice for children, various levels of
- 2 rem difficulty. Hit return or "y" return to keep on
- 3 rem playing. "n" return ends program.
- 4 rem by Dan Stubbs, Minnesota, member of MAST and STING
- 5 bit=0
- 10 fullw 2: clearw 2
- 20 a=10: gosub setheight
- 30 color 2,0,1
- 40 gotoxy 20,1: ? "Addition Magician - At Your Service"
- 50 color 1,0,1
- 60 if bit=1 goto 130
- 70 a=9 :gosub setheight
- 80 ? "Difficulty level 1 to 10"
- 90 input dif
- 100 level=dif*5
- 110 randomize peek(&h4bc)
- 120 bit=1
- 130 gotoxy 27,5
- 140 x1=int(rnd*level)
- 150 a=15 :gosub setheight
- 160 ? " "x1
- 170 gotoxy 27,8
- 180 y1=int(rnd*level)
- 190 ? "+"y1
- 200 gotoxy 27,10
- 210 correct = x1+y1
- 220 ? " --"
- 230 gotoxy 27,12
- 240 input ans
- 250 if ans=correct then gotoxy 29,12:? ans "is correct":goto 310
- 260 gotoxy 0,13
- 270 ? "Try again"
- 280 gosub drawsad
- 290 goto 230
- 300 gotoxy 2,18
- 310 gosub drawhappy
- 320 numr=numr+1
- 330 gotoxy 25,16:? numr "correct problems"
- 340 gotoxy 0,13
- 350 ?"Another problem (Y)": gotoxy 20,13
- 360 input rep$
- 370 if((rep$="n")or(rep$="N")) then goto 380 else goto 10
- 380 a=9: gosub setheight
- 390 end
- 400 setheight:
- 410 poke contrl ,107
- 420 poke contrl+2,0
- 430 poke contrl+6,1
- 440 poke intin ,a
- 450 vdisys
- 460 return
- 470 drawsad:
- 480 x=100:y=50:r=30
- 490 circle x,y,r
- 500 x1=x-.4*r:y1=y-.2*r:r1=r/6
- 510 circle x1,y1,r1
- 520 x2=x+.4*r
- 530 circle x2,y1,r1
- 540 color 1,3,1
- 550 pcircle x,y+.0*r,r/5
- 560 circle x,y+.3*r,r/4,0,1800
- 562 sound 1,8,8,5,15: sound 1,8,8,1,25:sound 1,0,0,0,0
- 570 return
- 580 drawhappy:
- 590 x=100:y=50:r=30
- 600 circle x,y,r
- 610 x1=x-.4*r:y1=y-.2*r:r1=r/6
- 620 circle x1,y1,r1
- 630 x2=x+.4*r
- 640 circle x2,y1,r1
- 650 color 1,2,1
- 660 pcircle x,y+.0*r,r/5
- 670 circle x,y+.2*r,r/4,1800,3600
- 672 sound 1,8,8,4,15:sound 1,8,10,4,15:sound 1,8,12,4,15
- 674 sound 1,8,6,5,10:sound 1,0,0,0,5: sound 1,8,6,5,10
- 676 sound 1,0,0,0,0
- 680 return
- ə